package sample.analysis;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

import java.io.File;


public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        File file = new File("conf"+File.separator+"javaFX_NmonAnalysisTools.fxml");
        //System.out.println(file.toURI().toURL());
        Parent root = FXMLLoader.load(file.toURI().toURL());
        //Parent root = FXMLLoader.load(getClass().getResource("view/javaFX_ToolsSummary.fxml"));//原用法
        primaryStage.setTitle("NmonAnalysisTools");
        //设置页面长、宽、高
        primaryStage.setScene(new Scene(root, 1200, 700));
        //设置关闭程序后停止所有线程
        primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent event) {
                System.exit(0);
            }
        });

        primaryStage.show();
    }
///Users/wutongchun/IdeaProjects/javaFX/javaFX_ToolsSummary/src/main/java/sample/view/javaFX_ToolsSummary.fxml
//Users/wutongchun/IdeaProjects/javaFX/javaFX_ToolsSummary/view/javaFX_ToolsSummary.fxml



    public static void main(String[] args) {
        launch(args);
    }
}
